package cn.fzkj.springboot.service;

import cn.fzkj.springboot.domain.Department;
import cn.fzkj.springboot.domain.DepartmentRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartmentService {

    @Autowired
    DepartmentRepository departmentRepository;


    public List<Department> findAll(){
        return departmentRepository.findAll();
    }

    public Department getOne(int id){
        return departmentRepository.getOne(id);
    }

    public Department insert(Department department){
        return departmentRepository.save(department);
    }


}
